<?php
require_once('Xml/Info/Entity.php');
require_once('Xml/Info/Exception.php');

abstract class Xml_Info_Abstract {
    private static $_instance = null;
    public abstract function getRssInfo();
    public abstract function getSitemapInfo();

    public function __call($_funName, $_args) {
        throw new Xml_Info_Exception("$_funName is not found in Xml_Info_Abstract");
    }

    protected function _fetchAll($sql) {
        $result = mysql_query($sql) ;
        if ($result == false) {
            throw new Xml_Info_Exception(sprintf('%s in %s on line %s', mysql_error(), __FILE__, __LINE__));
        }
        $rowset = array();
        while($row = mysql_fetch_assoc($result)) {
            $rowset[] = $row;
        }
        return $rowset;
    }
}
